"""myweb URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . import views
from .views import views_index,views_category,views_goods,views_user,views_order

urlpatterns = [
    # 首页
    url(r'^$',views_index.index,name='myadmin_index'),
    # 登录
    url(r'^login/$', views_index.myadminlogin, name='myadmin_login'),
    # 验证码
    url(r'^logincode/$', views_index.logincode, name='myadmin_logincode'),
    # 退出登录
    url(r'^logout/$', views_index.myadminlogout, name='myadmin_logout'),

    # 会员管理 添加
    url(r'^user/add/$',views_user.useradd,name='myadmin_user_add'),
    # 会员管理 显示
    url(r'^user/index/$',views_user.userindex,name='myadmin_user_index'),
    # 会员管理 编辑
    url(r'^user/edit/(?P<uid>[0-9]+)/$',views_user.useredit,name='myadmin_user_edit'),
    # 会员管理 删除
    url(r'^user/del/(?P<uid>[0-9]+)/$',views_user.userdel,name='myadmin_user_del'),

    # 商品分类管理 添加
    url(r'^cate/add/$',views_category.cateadd,name='myadmin_cate_add'),
    #列表页
    url(r'^cate/index/$',views_category.cateindex,name='myadmin_cate_index'),
    # 删除
    url(r'^cate/del/$', views_category.catedel, name='myadmin_cate_del'),
    # 修改
    url(r'^cate/edit/$', views_category.cateedit, name='myadmin_cate_edit'),

    # 商品管理 添加
    url(r'^goods/add/$', views_goods.goodsadd, name='myadmin_goods_add'),
    # 列表页
    url(r'^goods/index/$', views_goods.goodsindex, name='myadmin_goods_index'),
    # 修改
    url(r'^goods/edit/(?P<gid>[0-9]+)/$', views_goods.goodsedit, name='myadmin_goods_edit'),
    # 删除
    url(r'^goods/del/(?P<gid>[0-9]+)/$', views_goods.goodsdel, name='myadmin_goods_del'),

    # 订单管理 列表
    url(r'^order/index/$', views_order.orderindex, name='myadmin_order_index'),
    # 订单管理 状态修改
    url(r'^order/edit/$', views_order.orderedit, name='myadmin_order_edit'),
    # 订单管理 订单详情
    url(r'^order/info/$', views_order.orderinfo, name='myadmin_order_info'),


]

